<?php


class Root_page {
    //put your code here
    var $name ="Nguyen Nam Phu";
    var $pdo = null;
    var $tpl = null;
    var $error = null;
    
    
    var $bdtype = 'mysql';
    var $bdname = 'student';
    var $bdhost = 'localhost';
    var $dbuser = 'root';
    var $dbpass ='';
    
    function _contruct()
    {
        // instantiate the pdo object
        try {
          $dsn = "{$this->dbtype}:host={$this->dbhost};dbname={$this->dbname}";
          $this->pdo =  new PDO($dsn,$this->dbuser,$this->dbpass);

        } catch (PDOException $e) {
          print "Error!: " . $e->getMessage();
          die();
        }	
    }
//    set databse setting here!
    function  DisplayPage ($formvars = array())
    {
     $this->tpl = new Require_setup();
     $this->tpl->assign("title", "Nguyen Nam Phu");
     $this->tpl->display('index.tpl');
    }
}
